package net.csdra.libraryborrowing.service.book;

import net.csdra.libraryborrowing.domain.book.BookInfo;
import net.csdra.libraryborrowing.service.PageEntity;
import org.springframework.data.domain.Page;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import java.nio.file.AccessDeniedException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by xiaomi on 2017/10/17.
 */
public interface BookInfoManageService {

    BookInfo createBookInfo(CreateBookInfo createBookInfo) throws AccessDeniedException;

    BookInfo updateBookInfo(UpdateBookInfo updateBookInfo) throws AccessDeniedException;

    /**
     * 获取所有书籍信息列表
     *
     * @param getBookInfoPage
     * @return
     */
    Page<BookInfo> getBookInfoPage(BookInfoManageService.GetBookInfoPage getBookInfoPage);

    class CreateBookInfo {
        String name;
        String author;
        String isbn;
        //图书简介
        String info;
        //封面
        String cover;
        //副本总数
        int copyCount;
        //在馆副本总数
        int remainNumber;
        List<String> categoriees;
        String customize;
        Long order;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAuthor() {
            return author;
        }

        public void setAuthor(String author) {
            this.author = author;
        }

        public String getIsbn() {
            return isbn;
        }

        public void setIsbn(String isbn) {
            this.isbn = isbn;
        }

        public String getInfo() {
            return info;
        }

        public void setInfo(String info) {
            this.info = info;
        }

        public String getCover() {
            return cover;
        }

        public void setCover(String cover) {
            this.cover = cover;
        }

        public int getCopyCount() {
            return copyCount;
        }

        public void setCopyCount(int copyCount) {
            this.copyCount = copyCount;
        }

        public int getRemainNumber() {
            return remainNumber;
        }

        public void setRemainNumber(int remainNumber) {
            this.remainNumber = remainNumber;
        }

        public List<String> getCategoriees() {
            return categoriees;
        }

        public void setCategoriees(List<String> categoriees) {
            this.categoriees = categoriees;
        }
    }

    class UpdateBookInfo extends CreateBookInfo {
        String id;
        Boolean deleted;
        Boolean enabled;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public Boolean getDeleted() {
            return deleted;
        }

        public void setDeleted(Boolean deleted) {
            this.deleted = deleted;
        }

        public Boolean getEnabled() {
            return enabled;
        }

        public void setEnabled(Boolean enabled) {
            this.enabled = enabled;
        }
    }

    class GetBookInfoPage extends PageEntity {
    }
}
